import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-04-29
 * Time: 20:06
 */
class Person {
    public String ID;

    public Person(String ID) {
        this.ID = ID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(ID, person.ID);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ID);
    }
}
public class Test {

    public static void main(String[] args) {
        Person person1 = new Person("123");
        Person person2 = new Person("123");

        /*System.out.println(person1.hashCode());
        System.out.println(person2.hashCode());

        System.out.println(person1.equals(person2));*/

        HashBuck2<Person, String> hashBuck2 = new HashBuck2<>();
        hashBuck2.push(person1, "xiaoming");

        System.out.println(hashBuck2.getVal(person2));
    }

    public static void main2(String[] args) {
        HashBuck2<String, Integer> hashBuck2 = new HashBuck2<>();
        hashBuck2.push("abcd", 1);
        hashBuck2.push("def", 3);
        hashBuck2.push("hijk", 1);

        System.out.println(hashBuck2.getVal("abcd"));
    }
    public static void main1(String[] args) {
        HashBuck hashBuck = new HashBuck();
        hashBuck.push(1,11);
        hashBuck.push(2,22);
        hashBuck.push(3,33);
        hashBuck.push(4,44);
        hashBuck.push(5,55);
        hashBuck.push(6,66);
        hashBuck.push(7,77);

        System.out.println(hashBuck.getVal(1));
    }
}
